<?php
Yii::setPathOfAlias('EHtmlEditor',dirname(__FILE__));
Yii::import('EHtmlEditor.EMarkitupWidget');

class EHtmlEditor extends EMarkitupWidget
{
//        private $jqmodalId;
        
        /**
         * This method initialize the widget.
         */
        public function init()
        {
//    $this->settings='html';
//    $this->jqmodalId = ($this->hasModel()) ? get_class($this->model).'_'.$this->attribute : $this->jqmodalId = $this->attribute;
                parent::init();
        }
        
        public function run()
        {
                parent::run();
//
//                $jqmodal = <<<MODAL
//<div class="jqmWindow" id="{$this->jqmodalId}_preview">
//        <div class="jqmTitle">
//                <span>Preview</span>
//                <a href="#" class="jqmClose"><em>Close</em></a>
//        </div>
//        <div class="jqmContent"></div>
//</div>          
//MODAL;
//        
//                echo $jqmodal;
        }
        
        protected function registerClientScript()
        {
                parent::registerClientScript();
//                $cs=Yii::app()->getClientScript();
//                $cs->registerScriptFile(Yii::app()->request->baseUrl.'/js/jquery/jqmodal/jqModal.js');
//                $cs->registerCssFile(Yii::app()->request->baseUrl.'/js/jquery/jqmodal/jqModal.css');

//                $previewJs = <<<PREVIEW
//function previewMarkdown (container, url, content) {
//        var \$content = $(container+' .jqmContent');
//        \$content.addClass('loading').html('Please wait...');
//        $(container).jqmShow();
//        $.post(url,{'content':content},function(data){
//                \$content.removeClass('loading').html(data);
//        });
//}               
//PREVIEW;
//
//                $cs->registerScript('markitup-jqmodal-preview', $previewJs, CClientScript::POS_END);
//                $cs->registerScript($this->jqmodalId, "$('#{$this->jqmodalId}_preview').jqm();", CClientScript::POS_READY);
        }
}
?>
